package quoridor;

/**
 * Used to store information about the state of the current gameboard and past 
 * moves as well as validate moves and generating lists of possible moves.
 * @author Jono
 *
 */
public interface Board {
	/**
	 * Returns a coordinate object containing the location of the player
	 * identified by the colour parameter
	 * @param playerColour Colour of the player whose location is required
	 * @return Coordinate containing the player location.
	 */
	public Coordinate getPlayerLocation(PlayerColour playerColour);

	/**
	 * Returns true if the move given as a parameter is valid for the current
	 * state of the board and false otherwise.
	 * @param The move to be validated
	 * @return boolean Move is valid
	 */
	public boolean validateMove(Move move); 
	
	/**
	 * method used to determine whether the game has concluded.
	 * @return boolean value describing whether or not a player
	 * has won the game
	 */
	public boolean isOver();
	
	/**
	 * Undoes a single move, that is, retraces the gamestate to that which it was
	 * at one move ago.
	 * @return boolean indicating success of operation.
	 */
	public boolean undoMove();
	
	/**
	 * Redoes a single move if one is available AND if no new move has been made
	 * after the last undo.
	 * @return boolean indicating operation success
	 */
	public boolean redoMove();
	
	/**
	 * Enacts a move. Assumes the move is valid.
	 * @param move to be enacted
	 * @return boolean describing the success of the operation
	 */
	public boolean makeMove(Move move);
	
	/**
	 * Returns the history of the current board as a Glendennings string
	 * @return history string
	 */
	public String getHistory();
	
	/**
	 * Returns the colour of the player whose turn it is ie. the player who
	 * didn't have the last turn.
	 * @return PlayerColour of the player whose turn it is
	 */
	public PlayerColour currentPlayer();
	
	/**
    * Returns the colour of the player whose turn it isn't ie. the player who
    * had the last turn.
    * @return PlayerColour of the player whose turn it isn't
    */
	public PlayerColour opposingPlayer();
	
	/**
	 * Returns the number of fences remaining for the player specified
	 * @param player
	 * @return number of fences still held by player
	 */
	public int getFenceNum(PlayerColour player);
	
	/**
	 * Returns the 2d array of booleans representing horizontal fences.
	 * @return Horizontal fences
	 */
	public boolean[][] getHorizontalFences();
	
	/**
	 * Returns the 2d array of booleans representing vertical fences.
	 * @return Vertical fences
	 */
	public boolean[][] getVerticalFences();
	
	/**
	 * Returns the minimum number of squares between the position of the given
	 * player and the row that player needs to reach to win.
	 * @param player
	 * @return int number of steps to win
	 */
	public int distanceToFinish(PlayerColour player);
}